from django.urls import path
from . import views

urlpatterns = [
    # 认证相关
    path('auth/register/', views.register, name='register'),
    path('auth/login/', views.login, name='login'),
    path('auth/logout/', views.logout, name='logout'),
    path('auth/user/', views.get_current_user, name='current-user'),
    
    # 电影相关
    path('movies/', views.MovieListView.as_view(), name='movie-list'),
    path('movies/<int:pk>/', views.MovieDetailView.as_view(), name='movie-detail'),
    path('genres/', views.GenreListView.as_view(), name='genre-list'),
    
    # 评分相关
    path('ratings/', views.RatingListCreateView.as_view(), name='rating-list-create'),
    path('ratings/<int:pk>/', views.RatingDetailView.as_view(), name='rating-detail'),
    
    # 推荐相关
    path('recommendations/', views.get_recommendations, name='recommendations'),
    path('popular/', views.get_popular_movies, name='popular-movies'),
    path('user/stats/', views.get_user_stats, name='user-stats'),
    
    # 留言相关
    path('movies/<int:movie_id>/comments/', views.movie_comments, name='movie-comments'),
    path('comments/<int:comment_id>/', views.comment_detail, name='comment-detail'),
    path('user/comments/', views.user_comments, name='user-comments'),
    
    # 管理员接口
    path('admin/statistics/', views.admin_statistics, name='admin-statistics'),
    path('admin/users/', views.admin_users, name='admin-users'),
    path('admin/users/<int:user_id>/', views.admin_user_detail, name='admin-user-detail'),
    path('admin/movies/', views.admin_movies, name='admin-movies'),
    path('admin/movies/<int:movie_id>/', views.admin_movie_detail, name='admin-movie-detail'),
    path('admin/comments/', views.admin_comments, name='admin-comments'),
    path('admin/comments/<int:comment_id>/delete/', views.admin_delete_comment, name='admin-delete-comment'),
]